<?php defined('SYSPATH') or die('No direct script access.');
                          
class Static_Controller extends Template_Controller 
{
	public $template = 'layout/static';
	
	public function __construct()
	{
		parent::__construct();

		$this->db = new Database();
		
		$this->template->menu = '';
		$this->template->content =  '';
	}
	
	public function index($name)
	{
		$this->template->title = $name;
		self::showArticle($name);
	}
		
	protected function showArticle($name)
	{
		$model = new Article_Model();
		$view = new View('static/article');
		$view->article = $model->where('name', $name)->find();
		$view->title = $name;
		$this->template->content =  $view->render();
	}
}